package com.ruoyi.exampaperanswer.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.exampaperanswer.mapper.ExamPaperAnswerMapper;
import com.ruoyi.exampaperanswer.domain.ExamPaperAnswer;
import com.ruoyi.exampaperanswer.service.IExamPaperAnswerService;
import com.ruoyi.common.core.text.Convert;

/**
 * 答卷列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-25
 */
@Service
public class ExamPaperAnswerServiceImpl implements IExamPaperAnswerService 
{
    @Autowired
    private ExamPaperAnswerMapper examPaperAnswerMapper;

    /**
     * 查询答卷列表
     * 
     * @param id 答卷列表主键
     * @return 答卷列表
     */
    @Override
    public ExamPaperAnswer selectExamPaperAnswerById(Long id)
    {
        return examPaperAnswerMapper.selectExamPaperAnswerById(id);
    }

    /**
     * 查询答卷列表列表
     * 
     * @param examPaperAnswer 答卷列表
     * @return 答卷列表
     */
    @Override
    public List<ExamPaperAnswer> selectExamPaperAnswerList(ExamPaperAnswer examPaperAnswer)
    {
        return examPaperAnswerMapper.selectExamPaperAnswerList(examPaperAnswer);
    }

    /**
     * 新增答卷列表
     * 
     * @param examPaperAnswer 答卷列表
     * @return 结果
     */
    @Override
    public int insertExamPaperAnswer(ExamPaperAnswer examPaperAnswer)
    {
        examPaperAnswer.setCreateTime(DateUtils.getNowDate());
        return examPaperAnswerMapper.insertExamPaperAnswer(examPaperAnswer);
    }

    /**
     * 修改答卷列表
     * 
     * @param examPaperAnswer 答卷列表
     * @return 结果
     */
    @Override
    public int updateExamPaperAnswer(ExamPaperAnswer examPaperAnswer)
    {
        return examPaperAnswerMapper.updateExamPaperAnswer(examPaperAnswer);
    }

    /**
     * 批量删除答卷列表
     * 
     * @param ids 需要删除的答卷列表主键
     * @return 结果
     */
    @Override
    public int deleteExamPaperAnswerByIds(String ids)
    {
        return examPaperAnswerMapper.deleteExamPaperAnswerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除答卷列表信息
     * 
     * @param id 答卷列表主键
     * @return 结果
     */
    @Override
    public int deleteExamPaperAnswerById(Long id)
    {
        return examPaperAnswerMapper.deleteExamPaperAnswerById(id);
    }
}
